001 /*
002 * Copyright 2004-2005 Stephen J. McConnell.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
013 * implied.
014 *
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019 package net.dpml.util;
020
021 /**
022 * Transit Logger is a interface through which different logging solutions
023 * can be provided.
024 *
025 * @author <a href="http://www.dpml.net">Digital Product Meta Library</a>
026 * @version 1.0.1
027 */
028 public interface Logger
029 {
030 /**
031 * Return TRUE is trace level logging is enabled.
032 * @return the enabled state of trace logging
033 */
034 boolean isTraceEnabled();
035
036 /**
037 * Return TRUE is debug level logging is enabled.
038 * @return the enabled state of debug logging
039 */
040 boolean isDebugEnabled();
041
042 /**
043 * Return TRUE is info level logging is enabled.
044 * @return the enabled state of info logging
045 */
046 boolean isInfoEnabled();
047
048 /**
049 * Return TRUE is warn level logging is enabled.
050 * @return the enabled state of warn level logging
051 */
052 boolean isWarnEnabled();
053
054 /**
055 * Return TRUE is error level logging is enabled.
056 * @return the enabled state of error logging
057 */
058 boolean isErrorEnabled();
059
060 /**
061 * Record a trace level message.
062 * @param message the trace message to record
063 */
064 void trace( String message );
065
066 /**
067 * Record a debug level message.
068 * @param message the debug message to record
069 */
070 void debug( String message );
071
072 /**
073 * Record a informative message.
074 * @param message the info message to record
075 */
076 void info( String message );
077
078 /**
079 * Record a warning message.
080 * @param message the warning message to record
081 */
082 void warn( String message );
083
084 /**
085 * Record a warning message.
086 * @param message the warning message to record
087 * @param cause the causal exception
088 */
089 void warn( String message, Throwable cause );
090
091 /**
092 * Record a error level message.
093 * @param message the error message to record
094 */
095 void error( String message );
096
097 /**
098 * Record a error level message.
099 * @param message the error message to record
100 * @param cause the causal exception
101 */
102 void error( String message, Throwable cause );
103
104 /**
105 * Return a child logger relative to the current logger.
106 * @param category the relative category name
107 * @return the child logging channel
108 */
109 Logger getChildLogger( String category );
110 }
111
112